#ifndef SYMBOL_H_
#define SYMBOL_H_
#include "Number.h"
/*Data type for symbols*/

/* The whole arithmetic expression is stored in a tree. Inner nodes are
 * functions and operators, leaves are numbers, constants and symbols.
 * There are (at least) two ways to represent the nodes. One is using classes
 * and inheritance (class Node and then derived classes for functions, etc),
 * using methods and maybe overloaded operators.
 * The second way is using "variant record". Standard way of doing this is
 * with struct containing union, however this cannot be don, if (for example)
 * we use some nontrivial kinds of numbers. Other solution is letting all
 * possible types in node (and to save some memory, use pointers).
 *
 * I decided to use second approach, because a) I am more familiar with C
 * than C++, b) I can see deeper to what the program is doing. The user will
 * not have to see how the SymCe works inside.
 */

enum SymbolType{NUMBER=0, FUNCTION, OPERATOR, VARIABLE, CONSTANT}; /*Leave NUMBER first!*/
enum FunctionType{LN, SIN, COS, TAN}; /*Might add more probably */
enum OperatorType{PLUS, MULTIPLY, POWER};

/* This structure represents data stored in the tree*/
typedef struct{
	/*Symbol needs to keep track what kind of data it is
	and also actual data.*/
	enum SymbolType type;
	enum FunctionType func;
	enum OperatorType oper; /*although operator is not a keyword in C, leave it like this */
	Number * number; /*Use any number you want*/
	char * name; 
}Symbol;

int symbolcmp(const Symbol * first, const Symbol * second);
void symbolcpy(Symbol * dest, const Symbol * src);


#endif /*SYMBOL_H_*/
